home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / confirmd.c < prev    next >
C/C++ Source or Header  |  1996-07-10  |  3KB  |  132 lines

  1. /*
  2.                    CONFIRMED
  3.  
  4.  Function: handle the "confirmed" verb processing.
  5.  Input: pointer to "confirmed" structure.
  6.  
  7.  CopyRight 1995. Nicholas Poljakov all rights reserved.
  8.  
  9.  */
  10. #include <stdio.h>
  11. #include <confd.h>
  12. #include <state1.h>
  13. #include <rcb.h>
  14. #include <tcb.h>
  15. #include <cma.h>
  16. #include <repass.h>
  17. #include <string.h>
  18. #include <malloc.h>
  19.  
  20. int sk_r_wt(void *);
  21. int SendBlock(void *, void *);
  22. int setrc(void *, void *);
  23. int sendhsf(void *);
  24. int sendhs(void *);
  25. int sendbm(void *, void *);
  26. int sendat(void *);
  27. int rtsend(void *);
  28. unsigned long rmfmh5(void *, void *);
  29. int rcvru(void *, void *);
  30. int rcvhs(void *, void *, void *, void *);
  31. int ralloc(void *, void *);
  32. int psrm(int, void *, void *);
  33. int ps_conv(int, void *);
  34. int proterr(void *, unsigned long);
  35. int preptrcv(void *, void *);
  36. int post_rcb(void *);
  37. struct repass *postopen(void *);
  38. int phsrec(void *);
  39. int pfmh5(void *);
  40. int opndst(void *);
  41. int obtsess(void *, unsigned char);
  42. int Lrf_handler(void *);
  43. int get_sess(void *, void *);
  44. int get_attr(void *);
  45. int fsm_error(unsigned char, void *);
  46. int fsm_conv(unsigned char, unsigned char, void *);
  47. int flush (void *);
  48. int dcp(void *);
  49. int dealloc(void *);
  50. int crtp(void *);
  51. int conv(void *);
  52. int chkparm(void *, void *);
  53. int check_end(unsigned int, void *);
  54. struct rqb *call_appl(void *);
  55. int buffmng(unsigned char, void *, void *, void *, unsigned, unsigned char, unsigned);
  56. unsigned long attltck(void *);
  57. unsigned long attacheck(void *);
  58. char *cgetmem(int, int);
  59. int sendhsf(void *);
  60. int opndst(void *);
  61. int alloc_rcb(void *, void *);
  62. int allocate(void *);
  63. int clsdst(void *);
  64.  
  65. confirmd(pptr)
  66. struct confirmed *pptr;
  67. {
  68. struct rcb *p_rcb;
  69. struct tcb *ptr_tcb;
  70. struct cma ar;
  71. unsigned char type;
  72.  
  73. int code;
  74. int state;
  75.  
  76. #if OS_TYPE == 1 /* Unix System V */
  77. /*********  Trace facility **********/
  78. unsigned int rtype;   /* type of record */
  79. unsigned int pnum;    /* point number */
  80. char pname[8];        /* name of module */
  81. char *drec;       /* record for dump */
  82. int  lenr;            /* record length */
  83.  
  84. rtype = INPROC;
  85. strcpy(pname, "confd");
  86. pnum = 1;
  87. drec = pptr;
  88. lenr = sizeof(struct send_data);
  89. gtf(rtype, pname, pnum, drec, lenr);
  90. /***********************************/
  91. #endif
  92.  
  93.      if (chkparm(pptr, &ar) == -1) {
  94.         return(0);
  95.      }
  96.      p_rcb = ar.p_rcb;
  97.      ptr_tcb = ar.p_tcb;
  98.  
  99. #if OS_TYPE == 1
  100.      /* Check if the RCB is in the wait queue */
  101.      if (sk_r_wt(p_rcb) == 0) {
  102.         ptr -> prim_rc = INCOMPLETE;
  103.         return (0);
  104.      }
  105. #endif
  106.  
  107.     /*   place the verb code into the RCB */
  108.        p_rcb -> verb_code = pptr -> code;
  109.        p_rcb -> verb_ptr = (char *)pptr;
  110.  
  111.        pptr -> prim_rc = 0;
  112.        pptr -> sec_rc = 0;
  113.  
  114.        if ((state = fsm_conv('s', COnfirmed, p_rcb)) == -1)
  115.             {
  116.                 pptr -> prim_rc = PORT_ABENDED;
  117.         return 0;
  118.             }
  119.        if (state == 1)
  120.             {
  121.                 pptr -> prim_rc = PORT_ABENDED;
  122.         return 0;
  123.             }
  124.        else
  125.            {
  126.                 type = COnfirmed;
  127.                 buffmng('A', NULL, NULL, p_rcb, 0, 0, type);
  128.                 sendhsf(p_rcb);
  129.            }
  130.        return 0;
  131. }
  132.